package com.baizhi.cmfz.controller;

import com.baizhi.cmfz.annotation.LogAnnotation;
import com.baizhi.cmfz.service.LogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@RequestMapping("log")
public class LogController {
    @Autowired
    private LogService service;

    private   Logger logger = LoggerFactory.getLogger(LogController.class);


    @RequestMapping("selectAllLog")
    @ResponseBody
    @LogAnnotation("查看日志")
    public Map selectAllLog(int page,int rows,String username){

        Map map = service.selectAll(page,rows,username);
        logger.debug(""+map.get("rows"));
        return map;
    }
}
